package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.time.LocalDate;
import java.util.List;

@TableName("t_order")
public class OrderBean {
    /**
     * 订单id
     */
    @TableId(value = "pk_orderId",type = IdType.AUTO)
    private Integer id;
    /**
     * 收货人
     */
    @TableField("o_account")
    private String name;
    /**
     * 收货地址
     */
    @TableField("o_address")
    private String address;
    /**
     * 收货人电话
     */
    @TableField("o_phone")
    private String phone;
    /**
     * 下单时间
     */
    @TableField("o_createDate")
    private LocalDate createDate = LocalDate.now();
    /**
     * 订单总价
     */
    @TableField("o_sumPrice")
    private Integer sumPrice;
    /**
     * 订单状态
     */
    @TableField("o_status")
    private String status = "未送达";

    /**
     * 订单明细集合
     */
    @TableField(exist = false)
    private List<DetailsBean> detailList;
    /**
     * 用户对象
     */
    @TableField("fk_userId")
    private Integer userId;

    public OrderBean() {
    }

    public OrderBean(String name, String address, String phone, Integer sumPrice) {
        this.name = name;
        this.address = address;
        this.phone = phone;
        this.sumPrice = sumPrice;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public LocalDate getCreateDate() {
        return createDate;
    }

    public void setCreateDate(LocalDate createDate) {
        this.createDate = createDate;
    }

    public Integer getSumPrice() {
        return sumPrice;
    }

    public void setSumPrice(Integer sumPrice) {
        this.sumPrice = sumPrice;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public List<DetailsBean> getDetailList() {
        return detailList;
    }

    public void setDetailList(List<DetailsBean> detailList) {
        this.detailList = detailList;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }
}
